﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

namespace Zyg.SSO.Web.Admin.Log
{
    public partial class LogList : Zyg.SSO.Web.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.Account.HavePermission(Zyg.SSO.Core.Business.Permission.LogManage))
            {
                throw new Exception("您无权查看此页面");
            }

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        protected void BindData()
        {
            IList<Zyg.SSO.Core.Business.Log> logs = Zyg.SSO.Core.Business.Log.GetAllLog();
            GridViewLogList.DataSource = logs;
            GridViewLogList.DataBind();
        }

        protected void GridViewLogList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridViewLogList.PageIndex = e.NewPageIndex;
            BindData();
        }
    }
}
